<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>防火墙规则添加</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">

		function checkValidate()
		{

//			var name=document.getElementById("name").value;
//
//			//判断是否为空
//			if(name==null||name=="")
//			{
//				window.alertx("请输入防火墙规则名称！");
//				return false;
//			}
		}
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<li><a href="${ctx}/scene/sceneRouter/firewallList?environmentId=${environmentId}&type=${type}">防火墙</a></li>
	<li class="active"><a href="${ctx}/scene/sceneRouter/firewallRuleForm?firewallId=${firewallId}&environmentId=${environmentId}&type=${type}">添加防火墙规则</a></li>
</ul><br/>
<form id="inputForm" modelAttribute="SceneFirewallRule" action="${ctx}/scene/sceneRouter/firewallRuleSave" method="post" class="form-horizontal">
	<input type="hidden" id="type" name="type" value="${type}"/>
	<input type="hidden" id="firewallId" name="firewallId" value="${firewallId}"/>

	<input type="hidden" id="environmentId" name="environmentId" value="${environmentId}"/>
	<div class="control-group">
		<label class="control-label">名称：</label>
		<div class="controls">
			<input type="text" id="name" name="name" maxlength="64" class="input-xlarge required"/>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">协议：</label>
		<div class="controls">
			<select id="protocol" name="protocol" class="input-xlarge">
				<option value="tcp" selected>TCP</option>
				<option value="udp">UDP</option>
				<option value="imcp">IMCP</option>
			</select>
			<span class="help-inline"><font color="red">* 协议:需要检查的数据包类型</font> </span>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">动作：</label>
		<div class="controls">
			<select id="action" name="action" class="input-xlarge">
				<option value="allow" selected>允许</option>
				<option value="deny">丢弃</option>
			</select>
			<span class="help-inline"><font color="red">* 动作：过滤的类型，它能够允许、丢弃数据包。</font> </span>

		</div>
	</div>
	<div class="control-group">
		<label class="control-label">源IP地址/子网：</label>
		<div class="controls">
			<input type="text" id="sourceIpAddress" name="sourceIpAddress" maxlength="64" class="input-xlarge required"/>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">目的IP地址/子网：</label>
		<div class="controls">
			<input type="text" id="destinationIpAddress" name="destinationIpAddress" maxlength="64" class="input-xlarge required"/>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label">源端口/端口范围：</label>
		<div class="controls">
			<input type="text" id="sourcePort" name="sourcePort" maxlength="64" class="input-xlarge required"/>

			<span class="help-inline"><font color="red">端口范围例：80:90(:隔开)</font> </span>

		</div>
	</div>
	<div class="control-group">
		<label class="control-label">目的端口/端口范围：</label>
		<div class="controls">
			<input type="text" id="destinationPort" name="destinationPort" maxlength="64" class="input-xlarge required"/>
			<span class="help-inline"><font color="red">端口范围例：80:90(:隔开)</font> </span>

		</div>
	</div>
	<div class="control-group">
		<label class="control-label">IP版本：</label>
		<div class="controls">
			<select id="ipVersion" name="ipVersion" class="input-xlarge">
				<option value="4" selected>IPV4</option>
				<option value="6">IPV6</option>
			</select>
		</div>
	</div>
	<div class="form-actions">
		<shiro:hasPermission name="scene:sceneRouter:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" onclick=" return checkValidate()"/>&nbsp;</shiro:hasPermission>
		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
	</div>
</form>
</body>
</html>